﻿<Window x:Class="DemoPMFeatures.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:DemoPMFeatures" 
    Title="Power Management" Height="363" Width="469" 
    Loaded="Window_Loaded" Name="window1">
    <Window.Resources>
        <local:MyPowerSettings x:Key="powerSettings"/>
        <local:YesNoConverter x:Key="boolConverter"/>
    </Window.Resources>
    <Grid Height="321" Width="440" HorizontalAlignment="Left" 
          Margin="3,3,3,3"
          VerticalAlignment="Top" DataContext="{StaticResource powerSettings}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition  />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
            

        <TextBlock Height="27" Name="textBlock2" VerticalAlignment="Top" Text="Ready for events..." Grid.Row ="15" Grid.ColumnSpan="2" />
        <TextBlock Grid.Column="0" Grid.Row="0" Name="tb0" FontSize="12" 
                   Text="Power Personality:"/>
        <TextBlock Grid.Column="1" Height="29" 
                   Name="personalityText" VerticalAlignment="Top" 
                   Text="{Binding Path=PowerPersonality}"/>
        
        <TextBlock Grid.Column="0" Grid.Row="1" Name="tb1" FontSize="12" 
                   Text="Power Source:"/>
        <TextBlock Grid.Column="1" Grid.Row="1"  Height="29" 
                   Name="powerSourceText" VerticalAlignment="Top" 
                   Text="{Binding Path=PowerSource}"/>
        
        <TextBlock Grid.Column="0" Grid.Row="2" Name="tb2" FontSize="12" 
                   Text="Is Battery Present:"/>
        <TextBlock Grid.Column="1" Grid.Row="2"  Height="29" 
                   Name="batteryPresentText" VerticalAlignment="Top" 
                   Text="{Binding Path=BatteryPresent, Converter={StaticResource boolConverter}}"/>
        
        <TextBlock Grid.Column="0" Grid.Row="3" Name="tb3" FontSize="12" 
                   Text="Is UPS Present:"/>
        <TextBlock Grid.Column="1" Grid.Row="3"  Height="29" 
                   Name="upsText" VerticalAlignment="Top" 
                   Text="{Binding Path=UpsPresent, Converter={StaticResource boolConverter}}"/>
       
        <TextBlock Grid.Column="0" Grid.Row="4" Name="tb4" FontSize="12" 
                   Text="Is Battery Short Term:  "/>
        <TextBlock Grid.Column="1" Grid.Row="4"  Height="29" 
                   Name="batteryShortTermText" VerticalAlignment="Top" 
                   Text="{Binding Path=BatteryShortTerm, Converter={StaticResource boolConverter}}"/>
        
        <TextBlock Grid.Column="0" Grid.Row="5" Name="tb5" FontSize="12" 
                   Text="Battery Life (%):"/>
        <TextBlock Grid.Column="1" Grid.Row="5"  Height="29" 
                   Name="batteryLifeText" VerticalAlignment="Top" 
                   Text="{Binding Path=BatteryLifePercent}"/>

        <TextBlock Grid.Column="0" Grid.Row="6" Name="tb6" FontSize="12" 
                   Text="Is Monitor Required:"/>
        <TextBlock Grid.Column="1" Grid.Row="6"  Height="29" 
                   Name="monitorReqText" VerticalAlignment="Top" 
                   Text="{Binding Path=MonitorRequired, Converter={StaticResource boolConverter}}"/>
        
        <TextBlock Grid.Column="0" Grid.Row="7" Name="tb7" FontSize="12" 
                   Text="Is Monitor On:"/>
        <TextBlock Grid.Column="1" Grid.Row="7"  Height="29" 
                   Name="monitorOnText" VerticalAlignment="Top" 
                   Text="{Binding Path=MonitorOn, Converter={StaticResource boolConverter}}"/>
        
        <TextBlock Grid.Column="0" Grid.Row="8" Name="tb8" FontSize="12" 
                   Text="Battery State:"/>
        <TextBlock Grid.Column="1" Grid.Row="8" Grid.RowSpan="6"
                   Name="batteryStateText" VerticalAlignment="Top" 
                   Text="{Binding Path=BatteryState}"/>
    </Grid>
</Window>